package com.niit.mall.order.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.niit.mall.common.api.CommonResult;
import com.niit.mall.common.domain.dto.PageDTO;
import com.niit.mall.order.domain.dto.CartItemDTO;
import com.niit.mall.order.domain.dto.OrderDTO;
import com.niit.mall.order.domain.dto.OrderDetailDTO;
import com.niit.mall.order.domain.dto.OrderFormDTO;
import com.niit.mall.order.domain.po.Order;
import com.niit.mall.order.domain.query.OrderQuery;
import com.niit.mall.order.domain.vo.ConfirmVO;
import com.niit.mall.order.domain.vo.OrderDetailVO;

import java.util.List;
import java.util.Map;


/**
 * <p>
 * 订单表 服务类
 * </p>
 *
 * @author ChuXuan
 * @since 2025-05-26
 */
public interface IOrderService extends IService<Order> {

	ConfirmVO createOrder(CartItemDTO cartItemDTO);

	void markOrderPaySuccess(Long orderId);

	/**
	 * 分页查询所有订单
	 * @param query 查询参数
	 * @return 订单分页列表
	 */
	PageDTO<OrderDTO> queryAllOrders(OrderQuery query);

	/**
	 * 根据订单id获取订单详情
	 * @param id 订单id
	 * @return 订单详情
	 */
    OrderDetailDTO getDetailById(Long id);

	Map<Long, List<OrderDetailVO>> queryOrdersByType(Integer type);

	List<OrderDetailVO> queryRecentlyOrders();

	Map<Long, List<OrderDetailVO>> getAllProductByOrderId(Long id);

	Long queryTodayOrderCount();

	Long queryTomonthOrderCount();

	Long queryLastMonthOrderCount();
}
